import service from './http'

export function getUserList(data) {
  return service({
    url: 'users',
    method: 'get',
    params: {
      query: data.query,
      pagenum: data.pagenum,
      pagesize: data.pagesize
    }
  })
}

export function getState(uId, type) {
  return service({
    url: `users/${uId}/state/${type}`,
    method: 'put'
  })
}
//添加用户信息
export function addUser(body){
  return service({
    url:'users',
    method:'post',
    data:{
      username:body.username,
      password:body.password,
      email:body.email,
      mobile:body.mobile
    }
  })
}
//修改用户信息
export function editUser(data){
  return service({
    url:`users/${data}`,
    method:'put',
  })
}